package com.comenjoysoft.baselibrary.base;

import android.app.Application;
import android.content.Context;

public class BaseApplication extends Application {

    String TAG = "BaseApplication";

    public BaseApplication() {
    }

    private static Context instance;

    public static Context getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        init(this);
    }

    /**
     * 初始化方法
     *
     * @param application
     * @must 调用init方法且只能调用一次，如果extends NasApplication会自动调用
     */
    public static void init(Application application) {
        if (instance == null) {
            instance = application.getApplicationContext();
        }
    }
}